<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="js/jquery-3.2.1.min.js"></script>
    <title>淘宝购物车</title>
</head>
<style>
    * {
        margin: 0;
        padding: 0;
        list-style: none;
        text-decoration: none;
    }
    
    body {
        font-style: "微软雅黑";
        background-color: #ccc;
    }
    
    .header {
        height: 50px;
        margin: 0 auto;
        border: 1px solid #ddd;
        background-color: #fff;
    }
    
    .header h3 {
        text-align: center;
        line-height: 50px;
        font-size: 20px;
        clear: both;
    }
    
    .title {
        margin: 0 auto;
        margin-top: 10px;
        height: 40px;
        border: 1px solid #ddd;
        background-color: #fff;
        line-height: 40px;
    }
    
    .title .left {
        float: left;
        padding-left: 10px;
    }
    
    .title .right {
        float: right;
    }
    
    .title .right li {
        float: left;
        padding-left: 5px;
        padding-right: 5px;
    }
    
    .title .right .shu {
        color: #ddd;
    }
    
    .content {
        height: 120px;
        border: 1px solid #ddd;
        background-color: #fff;
        margin-bottom: 5px;
    }
    
    .content img {
        width: 100px;
        height: 100px;
        padding-top: 10px;
        padding-left: 5px;
        float: left;
    }
    
    .content p {
        padding-top: 10px;
        padding-left: 5px;
    }
    
    .content span {
        color: #999;
        width: 300px;
        padding-right: 10px;
    }
    
    .content a {
        padding-top: 10px;
        padding-left: 5px;
        color: #FFC125;
    }
</style>

<body>
    <div class="header">
        <h3>购物车(37)</h3>
    </div>
    <div class="title">
        <div class="left">蜗牛二手笔记></div>
        <ul class="right">
            <li>领卷</li>
            <li class="shu">|</li>
            <li>编辑</li>
        </ul>
    </div>
    <% for(var i=0;i<content.length;i++){ %>
        <div class="content">
            <img src="<%= content[i].picture %>">
            <p>
                <%= content[i].name %>
            </p><span><%= content[i].introduce %></span>
            <a>
                <%= content[i].money %>
            </a>
        </div>
        <%}%>
</body>
<script>
    $(function() {
        var isAjax = false;
        var length = 5;
        $(window).on("scroll", function(e) {
            // console.log(document.documentElement.scrollHeight);
            // console.log(document.body.scrollTop);
            if (isAjax) {
                return;
            }
            if (document.body.scrollTop + window.innerHeight > document.documentElement.scrollHeight - 20) {
                isAjax = true;
                console.log("滑动到底部");
            }
        })
    })
</script>

</html>